import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStream;

public class OutputStreamTest {
    public static void main2(String[] args) {
        try(OutputStream outputStream=new FileOutputStream("./aaa/bbb/ccc/hello.txt" )){
            byte [] arr=new byte[]{110,111,112,113,114,115};
            outputStream.write(arr);
            outputStream.close();//关闭文件资源
        }catch(IOException e){
            e.printStackTrace();
        }
    }
    public static void main1(String[] args) {
       try(OutputStream outputStream=new FileOutputStream("./aaa/bbb/ccc/hello.txt")) {
           outputStream.write(110);
           outputStream.write(111);
           outputStream.write(112);
           outputStream.close();//关闭文件资源
       }catch (IOException e){
           e.printStackTrace();
       }
    }
}
